Optimal. Leaf size=19 \[ a x+b x-\frac {b \tanh (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3554, 8}
\begin {gather*} a x-\frac {b \tanh (c+d x)}{d}+b x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3554
Rubi steps
\begin {align*} \int \left (a+b \tanh ^2(c+d x)\right ) \, dx &=a x+b \int \tanh ^2(c+d x) \, dx\\ &=a x-\frac {b \tanh (c+d x)}{d}+b \int 1 \, dx\\ &=a x+b x-\frac {b \tanh (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 28, normalized size = 1.47 \begin {gather*} a x+\frac {b \tanh ^{-1}(\tanh (c+d x))}{d}-\frac {b \tanh (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(46\) vs.
\(2(19)=38\).
time = 0.28, size = 47, normalized size = 2.47
method | result | size |
risch | \(a x +b x +\frac {2 b}{d \left (1+{\mathrm e}^{2 d x +2 c}\right )}\) | \(27\) |
default | \(a x -\frac {b \tanh \left (d x +c \right )}{d}-\frac {b \ln \left (\tanh \left (d x +c \right )-1\right )}{2 d}+\frac {b \ln \left (1+\tanh \left (d x +c \right )\right )}{2 d}\) | \(47\) |
derivativedivides | \(\frac {-b \tanh \left (d x +c \right )+\frac {\left (-a -b \right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\left (-a -b \right ) \ln \left (1+\tanh \left (d x +c \right )\right )}{2}}{d}\) | \(51\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 31, normalized size = 1.63 \begin {gather*} b {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 37, normalized size = 1.95 \begin {gather*} \frac {{\left ({\left (a + b\right )} d x + b\right )} \cosh \left (d x + c\right ) - b \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 20, normalized size = 1.05 \begin {gather*} a x + b \left (\begin {cases} x - \frac {\tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \tanh ^{2}{\left (c \right )} & \text {otherwise} \end {cases}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 29, normalized size = 1.53 \begin {gather*} a x + \frac {{\left (d x + c + \frac {2}{e^{\left (2 \, d x + 2 \, c\right )} + 1}\right )} b}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 18, normalized size = 0.95 \begin {gather*} x\,\left (a+b\right )-\frac {b\,\mathrm {tanh}\left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________